#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;
int f[1010][1010];
int main()
{
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		int x = 1;
		while (x <= i) {
			cout << x << " ";
			x++;
		}
		x = i - 1;
		while (x >= 1) {
			cout << x << " ";
			x--;
		}
		cout << endl;
	}
	return 0;
}